
from video_processor import VideoProcessor
from note_generator import NoteGenerator
from logger_setup import log

def main():
    """
    The main orchestrator for the entire video-to-notes pipeline.
    """
    log.info("=================================================")
    log.info("      STARTING VIDEO-TO-NOTES PIPELINE         ")
    log.info("=================================================")

    # Stage 1: Process all videos to get transcripts
    video_processor = VideoProcessor()
    transcript_paths = video_processor.process_all_videos()

    if not transcript_paths:
        log.warning("No transcripts were generated. Exiting pipeline.")
        return

    # Stage 2: Generate notes for each new transcript
    note_generator = NoteGenerator()
    for path in transcript_paths:
        note_generator.generate_notes_for_file(path)

    log.info("=================================================")
    log.info("      PIPELINE COMPLETED SUCCESSFULLY          ")
    log.info("=================================================")

if __name__ == "__main__":
    main()
